#ifndef CLIENTSOCKET_H
#define CLIENTSOCKET_H

#include <QObject>
#include <QTcpSocket>

class ClientSocket : public QObject
{
    Q_OBJECT
public:
    explicit ClientSocket(QObject *parent = nullptr);
signals:
    void receiveData(QString str);
    void connected();
public slots:
    void slotHostFound();
    void slotConnected();
    void slotDisconnected();
    void dataReceived();
    void slotError(QAbstractSocket::SocketError);

public:
    QTcpSocket *tcpSocket;

public:
    void connectToServer(const QString host, quint16 port);
    void sendValidateLoginData(const QString username, const QString password);
    ClientSocket(const QString host, quint16 port);
};

#endif // CLIENTSOCKET_H
